package ji.sky.recyclerview;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class MainActivity extends AppCompatActivity {
    private ListView listView_1;
    private ListView listView_2;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initWidgets();
    }

    protected void initWidgets(){
        listView_1 = findViewById(R.id.list_view1);
        listView_2 = findViewById(R.id.list_view2);
        String[] strArrDatas = getResources().getStringArray(R.array.str_arr_databinds);
        ArrayAdapter arrayAdapter = new ArrayAdapter<String>(this,
                android.R.layout.simple_list_item_1,strArrDatas);
        listView_1.setAdapter(arrayAdapter);

        ArrayAdapter arrayAdapter1 = new ArrayAdapter<String>(MainActivity.this,R.layout.item_a,R.id.tv_item_a,strArrDatas);
        listView_2.setAdapter(arrayAdapter1);
    }
}